package net.starwifi.duobao.jms.utils;

/*
 * <Info>
 *
 * @copyright   Copyright 2013-2013 武汉�?源智能系统有限公�? (http://www.kyzny.com)
 * @author      MeiSha <albertruo@gmail.com>
 * @version     <ID>1.0.3</ID>
 */

import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;
import java.util.Date;

/**
 * Created by ruo on 2014/8/6.
 */
public class UtilDateSerializer  implements JsonSerializer<Date> {

    public JsonElement serialize(Date src, Type typeOfSrc,JsonSerializationContext context) {
        return  new  JsonPrimitive(src.getTime());
    }

}